package cn.ycms.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.transaction.annotation.Transactional;

import cn.ycms.bean.GrouReso;
import cn.ycms.dao.bean.GrouResoDao;
import cn.ycms.service.GrouResoService;
import cn.ycms.utils.StringUtils;
@Transactional
public class GrouResoServiceI  extends ServiceUtil<GrouReso> implements GrouResoService{
@Resource GrouResoDao grouResoDao;
	public List<GrouReso> GetEntitybyCond(Map<String, Object> parms) {
		// TODO Auto-generated method stub
		return grouResoDao.queryByParams(parms);
	}

	public GrouReso GetEntitybyId(String id) {
		
		return grouResoDao.findById(id);
	}

	public List<GrouReso> GetEntitybyPage(Map<String, Object> parms, int Start,
			int limit) {
		
		return grouResoDao.queryByParams(parms, StringUtils.getPositiveInt(Start), StringUtils.getPositiveInt(limit));
	}

	public GrouReso GetFirstEntity() {
		// TODO Auto-generated method stub
		return grouResoDao.queryByParams(null, 1, 1).get(0);
	}

	public List<GrouReso> GetListAll() {
		// TODO Auto-generated method stub
		return grouResoDao.loadAll();
	}

	public int UpdateEntity(GrouReso entity) {
		grouResoDao.update(entity);
		return 1;
	}

	public int UpdatelistEntity(List<GrouReso> list) {
		grouResoDao.updatelist(list);
		return 1;
	}

	public void save(GrouReso entity) {
		grouResoDao.saveOrUpdate(entity);
		
	}

	public void saveList(List<GrouReso> list) {
		grouResoDao.save(list);
		
	}

	public String saveReturnId(GrouReso entity) {
		// TODO Auto-generated method stub
		return grouResoDao.save(entity);
	}

	/* (non-Javadoc)
	 * @see cn.ycms.service.PublicService#FalseDeleteByID(java.io.Serializable)
	 */
	public void FalseDeleteByID(String id) {
		
	GrouReso grouReso=grouResoDao.findById(id);
	grouReso.setMark(0);
	grouResoDao.update(grouReso);
		
	}

	/* (non-Javadoc)
	 * @see cn.ycms.service.PublicService#truedeletebyID(java.io.Serializable)
	 */
	public void truedeletebyID(String id) {
		grouResoDao.removeById(id);
		
	}

	
}
